﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WMS.Domain
{
    /// <summary>
    /// 订单费用表
    /// </summary>
    public class OrderFee
    {
        /// <summary>
        /// 主键
        /// </summary>
        [Key]
        public int Id { get; set; }

        /// <summary>
        /// 关联的已发货订单ID
        /// </summary>
        [Required]
        public int ShippedOrderId { get; set; }

        /// <summary>
        /// 费用类型 (出库费用、增值服务费用、其他费用等)
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string FeeType { get; set; }

        /// <summary>
        /// 费用名称
        /// </summary>
        [Required]
        [MaxLength(100)]
        public string FeeName { get; set; }

        /// <summary>
        /// 费用金额
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal Amount { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public int Quantity { get; set; }

        /// <summary>
        /// 单价
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal UnitPrice { get; set; }

        /// <summary>
        /// 费用说明
        /// </summary>
        [MaxLength(500)]
        public string Description { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedTime { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [MaxLength(50)]
        public string CreatedBy { get; set; }

        // 导航属性
        /// <summary>
        /// 关联的已发货订单
        /// </summary>
        [ForeignKey("ShippedOrderId")]
        public virtual ShippedOrder ShippedOrder { get; set; }
    }

}
